﻿<Window x:Class="ServiceConsumer.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <StackPanel>
            <TextBlock>This application adds customer and his/her address</TextBlock>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="150"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="80"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <TextBlock VerticalAlignment="Center">Enter customer name:</TextBlock>
                <TextBox Grid.Column="1" x:Name="CustomerName" HorizontalAlignment="Left" Width="200">Big Bird</TextBox>

                <StackPanel Grid.Column="2" Orientation="Horizontal">
                    <Button Width="40" Click="OnReset">Reset</Button>
                    <Button Width="40" Click="OnKill">Kill</Button>
                </StackPanel>
                
                <TextBlock Grid.Row="1" VerticalAlignment="Center">Enter address:</TextBlock>
                <TextBox Grid.Row="1" Grid.Column="1" HorizontalAlignment="Left" x:Name="Address" Width="200">Sesame Street</TextBox>
            
            </Grid>
            <StackPanel Orientation="Horizontal">
                <Button Click="OnAddCustomerSync">Add customer sync</Button>
            </StackPanel>
            <StackPanel Orientation="Horizontal">
                <Button Click="OnAddCustomerEvent">Add Customer event</Button>
                <Button Click="OnAddCustomerAPM">Add Customer APM</Button>
            </StackPanel>
            <StackPanel Orientation="Horizontal">
                <Button Click="OnAddCustomerEventWithExceptionHandling">Add Customer event with exception</Button>
            </StackPanel>
            <StackPanel Orientation="Horizontal">
                <Button Click="AddCustomerActionWithExceptionHandling">Add Customer event with exception - Action</Button>
                <Button Click="AddCustomerAndAddressAction">Add Customer and Address - Action</Button>
            </StackPanel>
            <StackPanel Orientation="Horizontal" Margin="0 5 0 0">
                <Button Click="AddCustomerAsync">Add Customer async</Button>
                
            </StackPanel>
            <StackPanel Orientation="Horizontal">

                <Button Click="AddCustomerAndAddressAsyncWithExceptionHandling">Add Customer and Address async - exception</Button>
            </StackPanel>
            <StackPanel Orientation="Horizontal">
                <Button Click="OnDoWork">DoWork</Button>
            </StackPanel>
                
            <StackPanel>
                <TextBlock>Result:</TextBlock>
                <TextBlock x:Name="Result" TextWrapping="Wrap"/>
            </StackPanel>
        </StackPanel>
        <Rectangle Fill="Gray" Opacity="0.75" x:Name="PendingLayer" Visibility="Collapsed"/>
    </Grid>
</Window>
